package com.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.entity.TblLock;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;


/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author 赵洛伟
 * @since 2019-08-02
 */
@Mapper
@Repository
public interface TblLockMapper extends BaseMapper<TblLock> {

    //解锁
    @Delete("DELETE FROM tbl_lock WHERE id = #{id}")
    int deletePrimaryKey(@Param("id") int id);

    //加锁
    @Insert("INSERT INTO tbl_lock(id) VALUES(#{id})")
    int inser(@Param("id") int id);
}
